﻿using System;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations;
using System.ComponentModel.DataAnnotations.Schema;
using Microsoft.EntityFrameworkCore;

namespace WCS.Infrastructure.EFCore;

/// <summary>
/// 分账协议详情表
/// </summary>
[Table("DividedAgreementDetail")]
[Index("DividedAgreementId", Name = "DividedAgreementDetail_DividedAgreementId_idx")]
[Index("SubAgreementId", Name = "DividedAgreementDetail_SubAgreementId_idx", IsUnique = true)]
public partial class DividedAgreementDetail
{
    /// <summary>
    /// 分账协议详情ID
    /// </summary>
    [Key]
    [StringLength(32)]
    public string Id { get; set; } = null!;

    /// <summary>
    /// 分账协议ID
    /// </summary>
    [StringLength(32)]
    public string DividedAgreementId { get; set; } = null!;

    /// <summary>
    /// 用户ID
    /// </summary>
    [StringLength(32)]
    public string? UserId { get; set; }

    /// <summary>
    /// 分账比例
    /// </summary>
    public decimal? Ratio { get; set; }

    /// <summary>
    /// 是否是主账户
    /// </summary>
    public bool IsMasterAccount { get; set; }

    /// <summary>
    /// 创建时间
    /// </summary>
    [Column(TypeName = "timestamp(6) without time zone")]
    public DateTime CreationTime { get; set; }

    /// <summary>
    /// 激活状态(0=未激活，1=已激活，用户确认后激活)
    /// </summary>
    public int ActivationStatus { get; set; }

    /// <summary>
    /// 用户角色ID
    /// </summary>
    [StringLength(32)]
    public string? UserRoleId { get; set; }

    /// <summary>
    /// 子协议ID
    /// </summary>
    [StringLength(32)]
    public string? SubAgreementId { get; set; }
}
